package com.minos.demos.web.pojo;


import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.*;

@Data
@NoArgsConstructor
public class HotelDoc {
    private String id;
    private String name;
    private String address;
    private Integer price;
    private Integer score;
    private String brand;
    private String city;
    private String starName;
    private String business;
    private String location;
    private String pic;
//    private Double distance;
//    private Boolean isAD; // 是否是广告
//    private List<String> suggestion;

    public HotelDoc(Hotel hotel) {
        this.id = hotel.getId().toString();
        this.name = hotel.getName();
        this.address = hotel.getAddress();
        this.price = hotel.getPrice();
        this.score = hotel.getScore();
        this.brand = hotel.getBrand();
        this.city = hotel.getCity();
        this.starName = hotel.getStarName();
        this.business = hotel.getBusiness();
        this.location = hotel.getLatitude() + ", " + hotel.getLongitude();
        this.pic = hotel.getPic();
//        if(this.business.contains("/")){
//            String[] arr = this.business.split("/");
//            this.suggestion = new ArrayList<>();
//            this.suggestion.add(this.brand);
//            Collections.addAll(this.suggestion, arr);
//        }else if(this.business.contains("、")){
//            String[] arr = this.business.split("、");
//            this.suggestion = new ArrayList<>();
//            this.suggestion.add(this.brand);
//            Collections.addAll(this.suggestion, arr);
//        }else{
//            this.suggestion = Arrays.asList(this.brand, this.business);
//        }

    }
}
